//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   Legendre_Equal_3D.hh
 * \author Jeremy Roberts
 * \date   06/19/2011
 * \brief  Legendre_Equal_3D class definition.
 * \note   Copyright (C) 2011 Jeremy Roberts
 */
//---------------------------------------------------------------------------//
// $Rev:: 115                                           $:Rev of last commit
// $Author:: j.alyn.roberts@gmail.com                   $:Author of last commit
// $Date:: 2011-07-01 07:20:26 +0000 (Fri, 01 Jul 2011) $:Date of last commit
//---------------------------------------------------------------------------//

#ifndef LEGENDRE_EQUAL_3D_HH
#define LEGENDRE_EQUAL_3D_HH

#include "angle/Quadrature.hh"

namespace slabtran
{

//===========================================================================//
/*!
 * \class Legendre_Equal_3D
 * \brief 3D Legendre, Equal Weight (PEn) quadrature class.
 *
 * As mentioned in \ref Level_Symmetric_3D, a fundamental problem inherent
 * to LQn quadrature is presence of negative weights at high order.  These
 * weights produce unphysical solutions (and may inhibit convergence).  For
 * problems where an increased quadrature order (i.e. more angles) is
 * required to study convergence or simply to get better answers, we
 * require an arbitrarily high order, positive weight quadrature.
 *
 * Here, we implement the "Legendre, equal weight" (PEn) quadrature of
 * Langoni, also called the "angle/Gauss, equal weight (GEn)" quadrature by
 * Carew and Zamonsky under certain assumptions.
 *
 * The PEn quadrature has the same structure as the LQn quadrature,
 * with different directions and weights.  That is, for order \f$ N \f$,
 * there are \f$ N(N+2)/8 \f$ ordinates per octant, yielding
 * \f$ N(N+2) \f$ directions for a 3D problem.  The the cosines of the polar
 * angle, \f$ \xi_i \f$, are taken to be the points of the
 * \f$ N \f$ point Gauss-Legendre quadrature, with associated weights
 * \f$ w_i \f$.
 *
 * The azimuthal angle \f$ \omega \f$ is uniformly partitioned according to
 * \f[
 *   \omega_{ij} = \Big ( j - \frac{1}{2} \Big )
 *   \frac{2\pi}{N_{\omega i}} \, , \,\,\, j = 1,\ldots,N_{\omega i} \, ,
 * \f]
 * where
 * \f[
 *   N_{\omega i} =  2(N-2i+2) \,
 * \f]
 * is the number of equal-weight angles on polar level \f$ i \f$.  The
 * corresponding weights are then
 * \f[
 *   w_{ij} = w_i / N_{\omega i} \, ,
 * \f]
 * subject to normalization.
 *
 * The PEn method is likely more accurate then the UEn (\ref
 * Uniform_Equal_3D) since the PEn method more accurately
 * approximates certain moments of interest (see the references).
 *
 * References:
 *
 * Langoni, G. <em>Advanced %Quadrature Sets, Acceleration and
 *     Preconditioning Techniques for the Discrete Ordinates Method
 *     in Parallel Computing Environments</em>. <b>Ph.D. Thesis</b>,
 *     U. Florida (2004).
 *
 * Carew, J. and Zamonsky. G., <em>Nuclear Science and Engineering</em>
 *     <b>131</b>, 199-207 (1999).
 *
 */
/*!
 * \example angle/test/testLegendre_Equal_3D.cc
 *
 * Test of Quadrature.
 */
//===========================================================================//

class Legendre_Equal_3D : public Quadrature
{
  private:
    //! Base class typedef.
    typedef Quadrature Base;

  public:
    // Constructor.
    Legendre_Equal_3D(int sn_order, double norm, int N=3);

    // Display the quadrature.
    void display() const;
};

} // end namespace slabtran

#endif // LEGENDRE_EQUAL_3D_HH

//---------------------------------------------------------------------------//
//              end of Legendre_Equal_3D.hh
//---------------------------------------------------------------------------//
